<template>
  <div class="RefundNotice">
    <div class="RefundNotice-Title">
      <div class="RefundNotice-Title-Left">
        <div class="RefundNotice-left"></div>
        <div class="RefundNotice-right">退费通知{{ItemList.noticeNo}}</div>
      </div>
    </div>
    <div class="RefundNotice-Body">
      <div class="RefundNotice-Body-Item" v-for="item in ItemList.wage_detail">
        <div class="item-title">
          <span>{{item.option}}（{{item.wage}}元）</span>
        </div>
        <div class="item-cont">
          <div class="RefundNotice-Body-Item-Title">
            {{item.return_option}}
          </div>
          <div class="RefundNotice-Body-Item-Num">
            {{item.return_money}}元
          </div>
        </div>
      </div>
    </div>

    <div class="RefundNotice-Body">
      <div class="RefundNotice-Body-Item top-border">
        <div class="item-cont  item-odd">
          <div class="item-odd">
            退款总额
          </div>
          <div class="item-odd">
            {{ItemList.return_money}}元
          </div>
        </div>
      </div>
      <div class="RefundNotice-Body-Item">
        <div class="item-cont  item-odd">
          <div class="item-odd">
            退款方式
          </div>
          <div class="item-odd">
            现金
          </div>
        </div>
      </div>
      <div class="RefundNotice-Body-Tips">
        请确认账户退费余额,如有疑问,请及时联系400-0000000000
      </div>
    </div>

    <div class="RefundNotice-Tips2">
      本次费用已返还
    </div>
    <div class="RefundNotice-Time">
      退费时间: {{ItemList.creattime}}
    </div>
    <div class="RefundNotice-Confirm">
      <button @click="GoToIndex()">返回</button>
    </div>
  </div>
</template>

<script>
  import {
    Indicator,
    Toast
  } from 'mint-ui';
  export default {
    name: 'RefundNotice',
    data() {
      return {
        ItemList: ''
      }
    },
    created: function () {
      //  var Notice = sessionStorage.getItem('Notice');
      // this.$store.state.Notice = JSON.parse(Notice);
      this.GetRouter = this.$route.params;
      this.getNotice();
      this.NoticeStu(this.GetRouter.view)
    },
    methods: {
      GoToIndex() {
        this.$router.push({
          path: this.$router.go(-1)
        })
      },
      // 获取退费详情
      getNotice() {
        var vm = this;
        this.$ApiCom.NoticeDetail(this.GetRouter.childrenid, this.GetRouter.id, this.GetRouter.type).then(function (res) {
          Indicator.close();
          if (res.data.errCode == 1001) {
            Indicator.open({
              text: '登陆失效...',
            });
            localStorage.clear();
            setTimeout(() => {
              Indicator.close();
              var Sid = localStorage.getItem('Sid');
              vm.$router.push({
                path: `/Login`
              })
            }, 1000);
          } else if (res.data.errCode == 1002) {
            Indicator.open({
              text: '授权失效...',
            });
            // 加密路径，回调路径
            var IndexInfo = encodeURIComponent(window.location.href);
            // 获取sessionId
            var sessionId = sessionStorage.getItem('sessionId');
            setTimeout(() => {
              Indicator.close();
              // 授权
              location.href = 'http://xyb.wujiaping.cn/parent/login/getWxInfo?redirectUri=' + IndexInfo +
                '&&sessionId=' + sessionId;
            }, 1000);
          } else if (res.status == 200) {
            vm.ItemList = res.data.data.noticeDetail;
            console.log(vm.ItemList)
          } else {
            Indicator.open({
              text: res.data.errMsg,
            });
            setTimeout(() => {
              Indicator.close();
              vm.$router.push({
                path: `/Index`
              })
            }, 1000);
          }
        })

      },
      // 已阅读状态
      NoticeStu(view) {
        if (view == 0) {
          this.$ApiCom.ParentIsViewNotice(this.GetRouter.childrenid, this.GetRouter.id, 3).then(function (res) {
          })
        }
      }
    }
  }

</script>

<style>
  @import url("css/RefundNotice.css");

</style>
